package com.chen.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.chen.pojo.DeptDO;
import com.chen.utils.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * 部门表 Mapper 接口
 * </p>
 *
 * @author chen
 * @since 2024-04-10
 */
@Mapper
public interface DeptMapper extends BaseMapperX<DeptDO> {
    /**
     * 根据name来查找部门
     *
     * @param name
     * @return
     */
    default DeptDO selectDeptByName(String name) {
        return selectOne(new LambdaQueryWrapper<DeptDO>()
                .eq(DeptDO::getName, name));
    }
}
